package com.hmdp.controller;


import com.hmdp.dto.Result;
import com.hmdp.entity.ShopType;
import com.hmdp.service.IShopTypeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @desc:查询shoptype 并加入到缓存中去查询
 * @author: weili23
 * @params
 * @Date: 2024/3/18 14:24
 * @version: 1.0
 */
@RestController
@RequestMapping("/shop-type")
public class ShopTypeController {
    @Resource
    private IShopTypeService typeService;

    @GetMapping("list")
    public Result queryTypeList() {
        /*List<ShopType> typeList = typeService
                .query().orderByAsc("sort").list();
        System.out.println("typeList = " + typeList);
        return Result.ok(typeList);*/
        //System.out.println("typeService.queryTypeList() = " + typeService.queryTypeList());
        return typeService.queryTypeList();
    }
}
